package com.hx.vending.service;

import com.hx.vending.bean.Goods;
import com.hx.vending.util.Msg;

import java.util.List;


/**
 * Created by Administrator on 2018/11/26.
 * 商品
 */
public interface IGoodsService {


    /**
     * 插入商品信息
     * @param goods
     * @return
     */
    Msg insertGoods(Goods goods, Integer userId);


    /**
     * 根据用户id及其他条件查询商品
     * @param userId
     * @param goods
     * @return
     */
    Msg selectGoodsByUserId(Integer userId, Goods goods, Integer pageNum, Integer pageSize);


    /**
     * 删除商品信息
     * @param goodsId
     * @return
     */
    Msg deleteGoods(Integer goodsId);


    /**
     * 修改商品信息
     * @param goods
     * @return
     */
    Msg updateGoods(Goods goods);

    Msg getGoodsByEquipmentInfo(String startTime, String endTime, List<Integer> fieldList,Integer userId);

    /**
     * 购买商品结算
     * @param equipmentId     设备id
     * @param trailsJsonStr   购物车信息 json   {货道号，数量}
     * @return
     */
    Msg updateBuyCommodity(String equipmentId, String trailsJsonStr) throws Exception;

    /**
     * 根据设备id查询商品信息(android显示需要)
     * @param equipmentId
     * @return
     */
    Msg selectGoodsByEquipmentId(String equipmentId);

    /**
     * 根据设备id查询商品信息(无屏售货机购买商品)
     * @param equipmentId
     * @return
     */
    Msg selectShopCartGoodsByEquipmentId(String equipmentId);

    /**
     * 特殊需求，购买结算商品前输入病区与床号
     * @param equipmentId              设备id
     * @param trailsJsonStr            商品jsonStr
     * @param areaNumber               病区
     * @param bedNumber                床号
     * @return
     */
    Msg insertMedicineOrder(String equipmentId, String trailsJsonStr, String areaNumber, String bedNumber);

    /**
     * 查询商品销售排行（不分设备，根据用户）
     * @param userId
     * @param startTime
     * @param endTime
     * @return
     */
    Msg selectGoodsRanking(Integer userId, String startTime, String endTime, Integer pageNum, Integer pageSize);

    Msg getGoodsStatisticsByUser(String startTime,Integer[] integers,String endTime, Integer fieldId, Integer userId,String condition,Integer pageNum);

    Msg getGoodsByEquipment(Integer userId,String startTime,String endTime,String equipmentId,Integer pageNum);

    Msg getOnlineByEquipment(Integer userId,String startTime,String endTime,String equipmentId,Integer pageNum);

    Msg getUnderlineByEquipment(Integer userId,String startTime,String endTime,String equipmentId,Integer pageNum);

    List<Goods> selectByExample(Goods goods);

    Msg getGoodsConsume(Integer userId,String startTime,String endTime,Integer[] integers);

    Msg getGoodsConsumeList(Integer userId,Integer[] integers,String startTime,String endTime,Integer pageNum);

    Msg getGoodsConsumeDetails(Integer onlineOrderId);

}
